// 登录
const mongoose = require("mongoose")

let storesModel = mongoose.model("storesModel")

module.exports.login = async function (user){
    const data = await storesModel.find(user)
    console.log(data)
    return data
}
module.exports.register = async function (user){
    const data = await storesModel.create(user)
    return data
}
module.exports.verify = async function (user){
    const data = await storesModel.find(user)
    return data
}

//徐芊的
module.exports.getStores = async function(user){
    const data = await storesModel.find(user)
    return data
}
//徐芊的
module.exports.updateStores = async function ({_id,state}){
    const data = await storesModel.updateOne({_id},{state})
    return data
}


